<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><extend name="common:base" />

        <block name="content">
            <div style="height: 32px;">
                <ul class="nav nav-tabs pull-left">
                    <li class="active"><a href="{{:url('sign/index')}}" class="index-url">签到</a></li>
                </ul>
            </div>

            <table class="table table-bordered table-hover top10" style="margin-bottom: 10px; font-size: 12px;">
                <tr class="table-header" style="background-color: #EFEFEF;">
                    <th>id</th>
                    <th>sign_id</th>
                    <th>签到周期</th>
                    <th>奖品名称</th>
                    <th>奖品图片</th>
                    <th style="text-align: center;">状态</th>
                    <th style="text-align: center;">操作</th>
                </tr>
                <volist name="data" id="voart">
                    <tr>
                        <td>{{$voart.id}}</td>
                        <td>{{$voart.sign_id}}</td>
                        <td>{{$voart.sign_count}}</td>
                        <td>{{$voart.sign_reward}}</td>
                        <td>
                            <img class="artlists-faceimg show-faceimg" src="{{$voart.img_url}}">
                        </td>
                        <td style="text-align: center;">
                            <eq name="voart.status" value="1">
                                <a class="btn btn-success btn-xs btn-editstatus" data-url="/index.php/admin/sign/edit_reward_status?status=0&id={{$voart.id}}">开启</a>
                                <else/>
                                <a class="btn btn-default btn-xs btn-editstatus" data-url="/index.php/admin/sign/edit_reward_status?status=1&id={{$voart.id}}">关闭</a>
                            </eq>
                        </td>
                        <td style="text-align: center;">
                            <a href="{{:url('sign/edit_reward_page', array('id' => $voart['id']))}}" class="btn btn-warning btn-xs">编辑</a>
                        </td>
                    </tr>
                </volist>
                <tr class="table-header" style="background-color: #EFEFEF;">
                    <th>id</th>
                    <th>sign_id</th>
                    <th>签到周期</th>
                    <th>奖品名称</th>
                    <th>奖品图片</th>
                    <th style="text-align: center;">状态</th>
                    <th style="text-align: center;">操作</th>
                </tr>
            </table>
            <div class="page-info">
                <div id="page_info"></div>
                <input type="hidden" id="allpages" value="{{$allpages}}" />
                <input type="hidden" id="nowpage" value="{{$nowpage}}" />
            </div>
        </block>

        <block name="footer">
            <script src="/static/js/laypage/laypage.js"></script>
            <script>
                // 清空 cookie 上一页 url
                $.cookie('edit_back_referrer', '', {path: '/'});

                // 实例化时间控件 laydate
                laydate.render({
                    elem: '#datetime_start', //指定元素
                    format: 'yyyy-MM-dd',
                });
                laydate.render({
                    elem: '#datetime_end', //指定元素
                    format: 'yyyy-MM-dd',
                });

                // ajax 分页
                laypage({
                    cont: 'page_info',
                    pages: $('body #allpages').val(),
                    curr: function(){
                        var page = $('body #nowpage').val();
                        return page ? page : 1;
                    }(),
                    skip: true, // 分页跳转
                    jump: function(e, first){
                        if(!first){
                            layer.load(0, {shade: [0.1, '#FFF']}); // 加载层
                            var formData = $('form[name="searchForm"]').serialize();
                            var url = '/admin/article/index?page=' + e.curr + '&' + formData;

                            window.location.href = url;
                            return false;
                        }
                    }
                });
            </script>
        </block></title>
</head>
<body>

</body>
</html>